//
//  YWVideoCollectioCell.m
//  网易新闻
//
//  Created by Yeewii@hotmail.com on 16/6/16.
//  Copyright © 2016年 Yeewii@hotmail.com. All rights reserved.
//

#import "YWVideoCollectioCell.h"
#import <UIImageView+WebCache.h>

@implementation YWVideoCollectioCell


- (void)awakeFromNib
{
    [super awakeFromNib];
    self.contentView.layer.borderColor   = [UIColor grayColor].CGColor;
    self.contentView.layer.borderWidth   = 1;
    self.contentView.layer.cornerRadius  = 10;
    self.contentView.layer.masksToBounds = YES;
}


-(void)setModel:(YWVideoInternalBaseClass1 *)model
{
    _model                  = model;
    [_bgImage sd_setImageWithURL:[NSURL URLWithString:_model.cover]];
    _titleLabel.text        = _model.title;
    [_iconImage sd_setImageWithURL:[NSURL URLWithString:_model.topicImg]];
    _sourceLabel.text       = _model.topicDesc;
    float sec               = _model.length/60;
    float secTemp           = ceil(sec);
    float secd              = fmod(_model.length, 60.0);
    _timeAndCountLabel.text = [NSString stringWithFormat:@"%.0f:%0.f %d播放",secTemp,secd,(int)_model.playCount];
}



@end
